import request from '/src/axios.js';
import {baseUrl} from "../../config/env";

export const toolCodeApi = {
  getList: (current, size, params) => request({
    url: baseUrl + '/ops-develop/code/list',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  }),
  build: (ids) => request({
    url: baseUrl + '/ops-develop/code/gen-code',
    method: 'post',
    params: {
      ids,
      system: 'saber'
    }
  }),
  remove: (ids) => request({
    url: baseUrl + '/ops-develop/code/remove',
    method: 'post',
    params: {
      ids,
    }
  }),
  add: (row) => request({
    url: baseUrl + '/ops-develop/code/submit',
    method: 'post',
    data: row
  }),
  update: (row) => request({
    url: baseUrl + '/ops-develop/code/submit',
    method: 'post',
    data: row
  }),
  copy: (id) => request({
    url: baseUrl + '/ops-develop/code/copy',
    method: 'post',
    params: {
      id,
    }
  }),
  getCode: (id) => request({
    url: baseUrl + '/ops-develop/code/detail',
    method: 'get',
    params: {
      id,
    }
  })
}
